//异步加载,后续再修改
//const Hello = r => require(['views/hello'], r);
//const NotFound = r => require(['views/notfound'], r);
import Vue from 'vue';
import VueRouter from 'vue-router';

import Login from '../views/Login';
import Home from '../views/Home';
import Hello from '../views/hello';
import NotFound from '../views/notfound';
import DashBoard from '../views/DashBoard';
import ManageUser from '../views/manage-system/ManageUser';
import ManageRoles from '../views/manage-system/ManageRoles';
import ManageStudent from '../views/manage-student/ManageStudent';
import ManageOrder from '../views/manage-order/ManageOrder';
import ManageInstitution from '../views/manage-institution/ManageInstitution';
import ManageMarketActivity from '../views/manage-market-activity/ManageMarketActivity';
import ManageAgency from '../views/manage-agency/ManageAgency';
import HolyWater from '../views/HolyWater';

Vue.use(VueRouter);

// 页面路由
const routes = [
  {
    path:'',
    redirect:'/index'
  },
  {
    path: '/index',
    name: 'index',
    component: HolyWater
  },
  {
    path: '*',
    name: 'notfound',
    component: NotFound
  },
  {
    path:'/dashboard',
    name:'dashboard',
    component:DashBoard,
    children:[
      {
        path:'',
        redirect:'/dashboard/manage-user'
      },
      {
        name:'manage-user',
        path:'manage-user',
        component:ManageUser
      },
      {
        name:'manage-roles',
        path:'manage-roles',
        component:ManageRoles
      },
      {
        name:'manage-student',
        path:'manage-student',
        component:ManageStudent
      },
      {
        name:'manage-order',
        path:'manage-order',
        component:ManageOrder
      },
      {
        name:'manage-institution',
        path:'manage-institution',
        component:ManageInstitution
      },
      {
        name:'manage-agency',
        path:'manage-agency',
        component:ManageAgency
      },
      {
        name:'manage-activity',
        path:'manage-activity',
        component:ManageMarketActivity
      }
    ]
  },
];

// 创建一个路由对象用于管理页面的路由
const router = new VueRouter({
  mode: 'history',
  routes: routes
});

export default router;
